package com.ybwh.springboot2.common.mybatis.plus.page;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 分页查询参数
 *
 * @param <T>
 */
@Data
public class PageParam<T> {
    @ApiModelProperty(value = "当前页号")
    private long current;
    @ApiModelProperty(value = "每页大小")
    private long size;
    @ApiModelProperty(value = "升序排列字段")
    private String[] ascs;
    @ApiModelProperty(value = "降序排列字段")
    private String[] descs;
    @ApiModelProperty(value = "查询条件")
    private T queryCondition;

    public PageParam() {
        this.size = 10L;
        this.current = 1L;
    }


    public PageInfo<T> toPageInfo() {
        PageInfo page = new PageInfo();

        page.setCurrent(current).setSize(size).setAsc(ascs).setDesc(descs).setQueryCondition(queryCondition);

        return page;


    }


}
